#include "dst.h"

#include "math.h"

#define M_PI 3.14159265358979323846

void dst()
{
	const long transformLength = 32;
	double inputData[transformLength];

	for ( long i=0; i<transformLength; ++i )
	{
		inputData[i] = sin( i * 2.f * M_PI / (transformLength/2));
	}

	double transformData[transformLength];

	long bin,k;
	double arg;
	for (bin = 0; bin < transformLength; bin++) {
		
		transformData[bin] = 0.;
		for (k = 0; k < transformLength; k++) {
			
			arg = (float)bin * M_PI *(float)k / (float)transformLength;
			transformData[bin] += inputData[k] * sin(arg);
		}
	}
}
